﻿<cfscript>    
    view = createObject("component", "views.layout");
    view.init("#APPLICATION.Name#", "","",index);
    view.pdf();
</cfscript>


<cffunction name="index" access="public" output="true" returntype="any">
    <cfscript>
        kq = createObject("component", "DatabaseQueries.Kronos");
        nq = createObject("component", "DatabaseQueries.Navigator");        
        Employee = kq.getCurrentEmployees(SESSION.myUserInfo.HR_PersonIDNo);
        EmployeeAddress = kq.getEmployeeAddress(SESSION.myUserInfo.HR_PersonIDNo);
        EmployeePhones = kq.getEmployeePhones(SESSION.myUserInfo.HR_PersonIDNo);
        EmployeeEmail = kq.getEmployeeEmail(SESSION.myUserInfo.HR_PersonIDNo);
        EmployeeContacts = kq.getEmployeeContacts(SESSION.myUserInfo.HR_PersonIDNo);
        EmployeeEducation = kq.getEmployeeEducation(SESSION.myUserInfo.HR_PersonIDNo);
        EmployeePayStatus = kq.getEmployeePayStatus(SESSION.myUserInfo.HR_PersonIDNo);
        EmployeeNav = nq.getNavEmployees(SESSION.myUserInfo.Finance_IDNO);
        EmployeeNav401K125 = nq.getNavEmployees401K125(SESSION.myUserInfo.Finance_IDNO);
    </cfscript>
    
    <cfdocument format="pdf">
    <style>
            .hideme{}
            a.important{color:red; display:none}
            /*  1) SCF APPS TOP LEVEL */

/***** BASIC *****/

        * { margin: 0; padding: 0; }
        body { font-family: Verdana, Geneva, sans-serif; font-size: 12px; color: ##454242; }
        a:link, a:visited { text-decoration: none; color: ##000; font-weight: bold; }
        a:hover { text-decoration: underline; color: ##DE442C; }
        li { list-style:none }
        h1 { font-size: 2em; }
        h2 { font-size: 1.2em; }
        h3 { font-size: 1em; }
        hr { color: ##ccc; border-style: dotted; }
        form { line-height: 1em; margin-bottom: 0; }
        input.btn { margin-top: 10px; font-weight: bold; color: ##666; background-color: ##eee;  filter:progid:DXImageTransform.Microsoft.Gradient  (GradientType=0, StartColorStr='##ffffffff', EndColorStr='##ffdddeee'); }
        input.btnhov { border-color: ##DE442C; background-color: ##DE442C; }
        input.highlightInput, select.highlightInput { background-color: ##eee; }
        .clear { clear: both; }
        .smaller { font-size: .8em; font-weight: normal; }
        .larger { font-size: 1.3em; }
        .important { font-weight: bold; color: ##DE442C; }
        .highlight { background: ##FF6; }
        .hidden { visibility: hidden; }
        .grayedOut { color: ##ccc; }
        .errorMsg { color: ##DE442C; font-weight: bold; }
        
        /***** TABLES *****/
        
        table { font-size: .9em; border-spacing: 0; border-collapse: collapse; text-align: left; }
        table td, table th { padding: 3px 10px; }
        table th { color: ##999; white-space: nowrap; }
        table tr.even td { background-color: ##eee; }
        
        /***** DATA TABLES *****/
        
        table.dataTable, table.dataTable td, table.dataTable th { border-color: ##ccc; border-style: solid; }
        table.dataTable { border-width: 0 0 1px 1px; }
        table.dataTable td { border-width: 1px 1px 0 0; }
        table.dataTable th { color: ##fff; background-image: url(/scfApps/images/ThBg.png); background-repeat: repeat-x; border-color: ##999; border-width: 1px 1px 0 1px; }
        table.dataTable td { background-color: ##fff; }
            
            /*  3) SCF APPS YELLOW */

            /***** BASIC *****/
            
            body { color: ##454242; }
            a:link, a:visited { color: ##000; }
            a:hover { color: ##DE442C; }
            h2 { color: ##ffcc00; }
            h3 { color: ##777; }
            hr { color: ##f9de73; }
            input.btn { color: ##777;  filter:progid:DXImageTransform.Microsoft.Gradient  (GradientType=0, StartColorStr='##ffffffff', EndColorStr='##fff9de73'); }
            input.btnhov { border-color: ##ccc ##DE442C ##DE442C ##ccc; }
            input.highlightInput, select.highlightInput { background-color: ##f8f9e1; }
            
            /***** TABLES *****/
            
            table th { color: ##777; }
            
            /***** DATA TABLES *****/
            
            table.dataTable th { color: ##fff; background-image: url(/scfApps/images/ThBgYellow.png); border-color: ##ccc; }
            
            /***** HEADER *****/
            
            ##header { background-image: url(/scfApps/images/headerBlack.gif); }
            ##header h2 { color: ##f9de73; border: none; }
            .headerColor { color: ##ffcc00; }
            
            /***** NAVIGATION *****/
            
            /* GLOBAL NAVIGATION */
            ##globalheader { width: 900px; height: 38px; position: relative; z-index: 9998; background-image: url(/scfApps/images/navBarBg.png); background-repeat: no-repeat; }
            ##globalheader ##globalnav { margin: 0; padding: 0; }
            ##globalheader ##globalnav li { display: inline; }
            ##globalheader ##globalnav li a { float: left; width: 117px; height: 0; padding-top: 38px; overflow: hidden; }
            ##globalheader ##globalnav li a, ##globalheader ##globalsearch { background-image: url(/scfApps/images/navBarYellow.png); background-repeat: no-repeat; }
            /* SUB NAVIGATION */
            .subnav li a { color: ##777; }
            .subnav li a:hover { background: ##f9de73; color: ##454242; }
            
            /***** MAIN *****/
            
            ##main h2 { border-top: ##f9de73 dotted 2px; }
            
            /***** SIDEBARS *****/
            
            ##sideBarLeft p, ##sideBarRight p { color: ##454542; }
            ##sideBarLeft hr, ##sideBarRight hr { color: ##ffcc00; }
            ##sideBarLeft li, ##sideBarRight li { color: ##454242; }
            ##sideBarLeft p a, ##sideBarRight p a { font-weight: bold; }
            ##sideBarLeft h2, ##sideBarRight h2 { background-image: url(/scfApps/images/ThBgYellow.png); }
            /* SIDEBAR BUTTONS */
            ##sideBarLinks a { color: ##FFF }
            ##sideBarLinks a:hover { background-image: url(/scfApps/images/buttonHoverBgYellow.png); background-repeat: repeat-x; border-top: 1px solid ##ffcc00; }
            
            /***** FOOTER *****/
            
            ##footer { border-top: ##f9de73 dotted 2px; }
            ##footer li { color: ##afafa8; }
            ##footer li a:link, ##footer li a:visited { color: ##ffcc00; }
            ##footer li a:hover { color: ##999; }

            ##menu {
                font-family: Arial, sans-serif;
                font-weight: bold;
                text-transform: uppercase;
                margin: 10px 0;
                padding: 0;
                list-style-type: none;
                background-color: ##eee;
                font-size: 13px;
                height: 40px;
                border-top: 2px solid ##eee;
                border-bottom: 2px solid ##ccc;
            }
            ##menu li {
                float: left;
                margin: 0;              
            }
            ##menu li a {
                text-decoration: none;
                display: block;
                padding: 0 20px;
                line-height: 40px;
                color: ##666;
            }
            ##menu li a:hover, ##menu li.active a {
                background-color: ##f5f5f5;
                border-bottom: 2px solid ##DDD;
                color: ##999;
            }
            ##menu_wrapper ul {margin-left: 12px;}
            ##menu_wrapper {
                padding: 0 15px 10px 0; 
                background: url(/ved/images/grey.png) no-repeat right;
            }
            ##menu_wrapper div {
                padding: 0 0 20px 0;
                float: left; 
                height: 44px; 
                width: 12px; 
                background: url(/ved/images/grey.png) no-repeat left;
            }
            
            /* Black Menu */
            ##menu_wrapper.black ul {
                border-top: 2px solid ##333;
                border-bottom: 2px solid ##000;
                background: ##333;
            }
            ##menu_wrapper.black a {color: ##CCC;}
            ##menu_wrapper.black li a:hover, ##menu_wrapper.black li.active a {
                color: ##999; 
                background: ##ffdf5f; 
                border-bottom: 2px solid ##444;
             }
            ##menu_wrapper.black {background: url(/ved/images/black.png) no-repeat right;}
            ##menu_wrapper.black div {background: url(/ved/images/black.png) no-repeat left;}
            
            

        </style>
    
        <table class="dataTable" width="100%">
        <thead>
            <tr>
                <th>Data - Kronos</th>
                <th>Current Value - Kronos</th>       
            </tr>
        </thead>
        <tbody>
            <tr>
                <td width="35%"><strong>Name</strong></td>
                <td>
                    <strong>First:</strong> #Employee.FirstName# 
                    <strong> Middle:</strong> #Employee.MiddleName# 
                    <strong>Last:</strong> #Employee.LastName#
                </td>
            </tr>
            <tr>
                <td><strong>Home Address</strong></td>
                <td>
                    <cfloop query="EmployeeAddress" >
                        <cfif trim(EmployeeAddress.PersonAddressTypeIdNo) EQ "13">
                            #EmployeeAddress.PersonAddress1# #( EmployeeAddress.PersonAddress2 eq "" ? "" : EmployeeAddress.PersonAddress2 )#
                            #EmployeeAddress.PersonAddressCity#, #EmployeeAddress.State# #EmployeeAddress.PersonAddressPostalCode#
                        </cfif>
                    </cfloop>
                </td>
            </tr>
            <tr>
                <td><strong>Mailing Address</strong></td>
                <td>
                    <cfloop query="EmployeeAddress" >
                        <cfif trim(EmployeeAddress.PersonAddressTypeIdNo) EQ "17">
                            #EmployeeAddress.PersonAddress1# #( EmployeeAddress.PersonAddress2 eq "" ? "" : EmployeeAddress.PersonAddress2 )#
                            #EmployeeAddress.PersonAddressCity#, #EmployeeAddress.State# #EmployeeAddress.PersonAddressPostalCode#
                        </cfif>
                    </cfloop>
                </td>
            </tr>
            <tr>
                <td><strong>Home Phone Number</strong></td>
                <td>
                    <cfloop query="EmployeePhones" >
                        <cfif trim(EmployeePhones.TypeCode) EQ "Home">
                            #EmployeePhones.PersonPhoneNo#
                        </cfif>
                    </cfloop>
                </td>
            </tr>
            <tr>
                <td><strong>Mobile Phone Number</strong></td>
                <td>
                    <cfloop query="EmployeePhones" >
                        <cfif trim(EmployeePhones.TypeCode) EQ "Mobile">
                            #EmployeePhones.PersonPhoneNo#
                        </cfif>
                    </cfloop>
                </td>
            </tr>
            <tr>
                <td><strong>Personal Email</strong></td>
                <td>
                    <cfloop query="EmployeeEmail" >
                        #EmployeeEmail.EmailAddress# &nbsp;
                    </cfloop>                    
                </td>
            </tr>
            <tr>
                <td><strong>Emergency Contact 1</strong></td>
                <td>
                    <cfloop query="EmployeeContacts" >
                        <cfif EmployeeContacts.EmergencyContactCallOrder EQ 1>
                            <strong>#EmployeeContacts.FirstName# #EmployeeContacts.LastName#:</strong>
                            #EmployeeContacts.PersonAddress1# #( EmployeeContacts.PersonAddress2 eq "" ? "" : EmployeeContacts.PersonAddress2 )#
                            #EmployeeContacts.PersonAddressCity#, #EmployeeContacts.State# #EmployeeContacts.PersonAddressPostalCode#
                        </cfif>
                    </cfloop>
                </td>
            </tr>
            <tr>
                <td><strong>Emergency Contact 2</strong></td>
                <td>
                    <cfloop query="EmployeeContacts" >
                        <cfif EmployeeContacts.EmergencyContactCallOrder EQ 2>
                            <strong>#EmployeeContacts.FirstName# #EmployeeContacts.LastName#:</strong>
                            #EmployeeContacts.PersonAddress1# #( EmployeeContacts.PersonAddress2 eq "" ? "" : EmployeeContacts.PersonAddress2 )#
                            #EmployeeContacts.PersonAddressCity#, #EmployeeContacts.State# #EmployeeContacts.PersonAddressPostalCode#
                        </cfif>
                    </cfloop>
                </td>
            </tr>
            <tr>
                <td><strong>Education 1</strong></td>
                <td>
                    <cfloop query="EmployeeEducation" >
                        <cfif EmployeeEducation.CurrentRow EQ 1>
                            #EmployeeEducation.GraduationYear# #EmployeeEducation.College# #EmployeeEducation.Degree# #EmployeeEducation.Major#
                        </cfif>
                    </cfloop>                    
                </td>
            </tr>
            <tr>
                <td><strong>Education 2</strong></td>
                <td>
                    <cfloop query="EmployeeEducation" >
                        <cfif EmployeeEducation.CurrentRow EQ 2>
                            #EmployeeEducation.GraduationYear# #EmployeeEducation.College# #EmployeeEducation.Degree# #EmployeeEducation.Major#
                        </cfif>
                    </cfloop>
                </td>
            </tr>
            <tr>
                <td><strong>Education 3</strong></td>
                <td>
                    <cfloop query="EmployeeEducation" >
                        <cfif EmployeeEducation.CurrentRow EQ 3>
                            #EmployeeEducation.GraduationYear# #EmployeeEducation.College# #EmployeeEducation.Degree# #EmployeeEducation.Major#
                        </cfif>
                    </cfloop>
                </td>
            </tr>
            <tr>
                <td><strong>Position</strong></td>
                <td>
                    <strong>Title:</strong> #Employee.Title# 
                    <strong>Department:</strong> #Employee.Department# 
                    <strong>Division:</strong> #Employee.Division#
                </td>
            </tr>
            <tr>
                <td><strong>Current Rate of Pay</strong> <!---<img src="images/dialog-warning.png" />---></td>
                <td>
                    <a href="##" id="payrate" class="important" onclick="return false;">Click here to Show Payrate</a>
                    <span class="hideme" id="payrate">#NumberFormat(EmployeePayStatus.PayRate, '$__.__')# x #EmployeePayStatus.AnnualizingFactor# = #NumberFormat(EmployeePayStatus.PayRate * EmployeePayStatus.AnnualizingFactor, '$__.__')#</span>
                </td>
            </tr>
            <tr>
                <td><strong>Scheduled Hours Per Week (FTE)</strong></td>
                <td>#NumberFormat(EmployeePayStatus.StandardUnitsPerWeek, '_')#</td>
            </tr>
        </tbody>
    </table>
    <br />
    <br />
    <table class="dataTable" width="100%">
        <thead>
            <tr>
                <th>Data - Navigator</th>
                <th>Current Value - Navigator</th>                
            </tr>
        </thead>
        <tbody>
            <tr>
                <td width="35%"><strong>Name</strong></td>
                <td>
                    <strong>First:</strong> #EmployeeNav.FirstName# 
                    <strong> Middle:</strong> #EmployeeNav.MiddleName# 
                    <strong>Last:</strong> #EmployeeNav.LastName#
                </td>                
            </tr>
            <tr>
                <td><strong>Date of Birth</strong></td>
                <td>#DateFormat(EmployeeNav.DOB, "mm/dd/yyyy")#</td>
            </tr>
            <tr>
                <td><strong>Mailing Address</strong></td>
                <td>
                     #EmployeeNav.Address# #( EmployeeNav.Address2 eq "" ? "" : EmployeeNav.Address2 )#
                     #EmployeeNav.City#, #EmployeeNav.State# #EmployeeNav.PostCode#
                </td>
            </tr>
            <tr>
                <td><strong>Primary Phone Number</strong></td>
                <td>#EmployeeNav.HomePhoneNumber#</td>
            </tr>
            <tr>
                <td><strong>Section 125 Cafeteria Plan</strong></td>
                <td>
                    <cfloop query="EmployeeNav401K125" >
                        <cfif EmployeeNav401K125.PayrollRateCode EQ "125REIMBAM">
                            <strong>Unreimbursed Healthcare:</strong> #NumberFormat(EmployeeNav401K125.Amount)#
                        </cfif>
                    </cfloop>
                    <br />
                    <cfloop query="EmployeeNav401K125" >
                        <cfif EmployeeNav401K125.PayrollRateCode EQ "125 DC AMT">
                            <strong>Dependent Daycare:</strong> #NumberFormat(EmployeeNav401K125.Amount)#
                        </cfif>
                    </cfloop>
                </td>
            </tr>
            <tr>
                <td><strong>Medical Coverage</strong></td>
                <td></td>
            </tr>
            <tr>
                <td><strong>401(K) Withholding</strong></td>
                <td>
                    <cfloop query="EmployeeNav401K125" >
                        <cfif EmployeeNav401K125.PayrollRateCode EQ "401k PERC">
                            #(EmployeeNav401K125.Amount * 100)#%
                        </cfif>
                    </cfloop>
                </td>
            </tr>
            <tr>
                <td><strong>Work Schedule</strong></td>
                <td>
                    <cfloop query="EmployeeNav401K125" >
                        <cfif EmployeeNav401K125.PayrollRateCode EQ "WORK WEEK">
                            #NumberFormat(EmployeeNav401K125.Amount)#
                        </cfif>
                    </cfloop>
                </td>
            </tr>
            <tr>
                <td><strong>Banking Information</strong></td>
                <td></td>
            </tr>
            <tr>
                <td><strong>W-4 Election</strong></td>
                <td>
                    <strong>Marital Status:</strong> #EmployeeNav.FilingStatusCode# 
                    <strong>Allowances:</strong> #EmployeeNav.ExtraWithholding# 
                    <strong>Additional Withholding:</strong> #EmployeeNav.Allowances#
                </td>
            </tr>
        </tbody>
    </table>
    </cfdocument>
</cffunction>